const routes = [
  {
    path: '/',
    component: () => import('layouts/MainLayout.vue'),
    redirect: '/login',
    children: [
      { path: 'index', name: 'index', component: () => import('pages/IndexPage.vue') },
      { path: 'collection', name: 'collection', component: () => import('pages/CollectionsPage.vue') },
      { path: 'group', name: 'group', component: () => import('pages/GroupPage.vue') },
      { path: 'write', name: 'write', component: () => import('pages/WritePage.vue') },
      { path: 'person', name: 'person', component: () => import('pages/PersonPage.vue') },
    ]
  },
  {
    path: '/admin',
    component: () => import('layouts/AdminLayout.vue'),
    children: [
      { path: 'index', name: 'adminIndex', component: () => import('pages/admin/StaticalPage.vue') },
      { path: 'blogs', name: 'adminBlogs', component: () => import('pages/admin/BlogsPage.vue') },
      { path: 'comments', name: 'adminComments', component: () => import('pages/admin/CommentsPage.vue') },
    ]
  },
  {
    path: '/login',
    component: () => import('pages/LoginPage.vue'),
  },
  {
    path: '/detail',
    component: () => import('pages/DetailPage.vue'),
    name: 'detail',
  },
  {
    path: '/:catchAll(.*)*',
    component: () => import('pages/ErrorNotFound.vue')
  }
]

export default routes
